import React, { Component } from 'react';
import Item from './children/item';
class Index extends Component {
    state = {
        count:1,
        person:{
            age:10
        }
    }
    render() {
        return (
            <div>
                <Item person={this.state.person}></Item>
                <button onClick={this.handleAdd}>add--{this.state.person.age}</button>
            </div>
        );
    }
    handleAdd=()=>{
        let person  = this.state.person;
        person.age++;
        this.setState({
            person
        })
    }
}

export default Index;